import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsNumber, IsString, IsEnum } from 'class-validator';

export class CreateOrderDto {
  @ApiPropertyOptional({ description: '商品ID' })
  @IsOptional()
  @IsNumber()
  productId?: number;

  @ApiPropertyOptional({ description: '会员等级', enum: ['vip', 'svip'] })
  @IsOptional()
  @IsEnum(['vip', 'svip'])
  membershipLevel?: 'vip' | 'svip';

  @ApiPropertyOptional({ description: '会员月数' })
  @IsOptional()
  @IsNumber()
  membershipMonths?: number;

  @ApiPropertyOptional({ description: '优惠券码' })
  @IsOptional()
  @IsString()
  couponCode?: string;
}
